package com.zkzx.driver.client;

import com.zkzx.common.company.model.CompanyDriverVO;
import com.zkzx.common.company.model.CompanyVO;
import com.zkzx.common.vo.PageResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;
import java.util.List;

/**
 * 北京中科智兴物联科技有限公司 @版权所有
 *
 * @Author: zhaoyihe@zkraising.com
 * @Date: 2021/05/10/15:34
 * @Description:
 */
@FeignClient(value = "ZKZX-COMPANY-BASE") // 本地调用 先以接口地址为准进行调用
//@FeignClient(name = "ZKZX-COMPANY-BASE",url = "http://localhost:28080")
public interface CompanyDriverClient {

    @PostMapping("/ZKZX-COMPANY-BASE/company_drivers")
    void add(@RequestBody CompanyDriverVO companyDriverVO);

    @GetMapping("/ZKZX-COMPANY-BASE/company_drivers/company_driver")
    List<CompanyDriverVO> getByDriverIdAndCompanyId(@RequestParam("driver_id")Integer driverId, @RequestParam("company_id")Integer companyId);

    @PutMapping("/ZKZX-COMPANY-BASE/company_drivers")
    void  update(@RequestBody @Valid CompanyDriverVO companyDriverVO);
    @GetMapping("/ZKZX-COMPANY-BASE/company_drivers")
    PageResult<CompanyDriverVO> find(@RequestParam("filterParam") String filterParamJson, @RequestParam("params") String paramsJson);

    @GetMapping("/ZKZX-COMPANY-BASE/companies/{id}")
    CompanyVO getById(@PathVariable("id") Integer id);

    //短信发送
    @GetMapping("/ZKZX-COMPANY-BASE/sms")
    Boolean sendSms(@RequestParam("phone_numbers") String phoneNumbers, @RequestParam("template_code") String templateCode, @RequestParam("template_param") String templateParam);

}
